<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreateOrderExpressesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('order_expresses')) {
            Schema::create('order_expresses', function (Blueprint $table) {
                $table->id();
                $table->string('name')->comment('快递公司');
                $table->string('code')->nullable()->comment('快递公司代号');
                $table->timestamps();
            });
            DB::statement("ALTER TABLE `order_expresses` comment '快递公司表'");
        }
        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_expresses');
    }
}
